package com.course.component.listeners;
/*
@author By 林中小鸟
@package  com.self.introduction.component.listeners
@create 2022 - 01 - 2022\1\10 0010
@QQ: 357182695
@Em: themooncss@gmail.com
*/

import com.course.component.aspects.LogAspect;
import com.course.component.events.TestEvent;
import com.course.entity.File;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Component
public class TestEventListener {

    private final static Logger LOG = LoggerFactory.getLogger(LogAspect.class);

    @EventListener
    public void onApplicationEvent(ApplicationEvent event) throws InstantiationException, IllegalAccessException {
        if(event instanceof TestEvent){
            LOG.info("------------- Krpano切片开始 -------------");
            /*上传用切面，切图用监听事件*/
            File file  = (File) event.getSource();
            LOG.info("------------- Krpano切片完成 -------------");
        }
    }
}
